//
//  UIView+Extension.h
//  ChatForHot
//
//  Created by wr on 2018/10/17.
//  Copyright © 2018年 FLY. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "HOTCHATEmptyView.h"

@interface UIView (Extension)

+ (id)viewFromNib;
@end

typedef void(^EmptyActionButtonBlock)(void);

@interface UIView (Empty)

@property(nonatomic,strong) HOTCHATEmptyView *emptyView;
@property(nonatomic,assign,readonly,getter = isEmptyViewShowing) BOOL emptyViewShowing;

- (void)showEmptyView;

- (void)showEmptyViewWithLoading;
- (void)showEmptyCommentViewWithReloadData:(EmptyActionButtonBlock)block;
- (void)showErrorEmptyViewWithReloadData:(EmptyActionButtonBlock)block;
- (void)showEmptyViewWithReloadData:(EmptyActionButtonBlock)block;
- (void)showEmptyViewWithImage:(UIImage *)image;

- (void)showEmptyViewWithText:(NSString *)text
                   detailText:(NSString *)detailText
                  buttonTitle:(NSString *)buttonTitle
                 buttonAction:(SEL)action;
- (void)showEmptyViewWithText:(NSString *)text
                   detailText:(NSString *)detailText
                  buttonTitle:(NSString *)buttonTitle
                        block:(EmptyActionButtonBlock)block;

- (void)showEmptyViewWithImage:(UIImage *)image
                          text:(NSString *)text
                    detailText:(NSString *)detailText
                   buttonTitle:(NSString *)buttonTitle
                  buttonAction:(SEL)action;
- (void)showEmptyViewWithImage:(UIImage *)image
                          text:(NSString *)text
                    detailText:(NSString *)detailText
                   buttonTitle:(NSString *)buttonTitle
                         block:(EmptyActionButtonBlock)block;

- (void)hideEmptyView;
- (BOOL)layoutEmptyView;
@end

